#include <iostream>

// 声明实体类型的枚举
enum class EntityCategory {
    BASE,
    EXTENDED,
    ASSOCIATED
};

//将enum class中的类型转换成string，同时也方便输出
std::string getCategoryString(EntityCategory category) {
    switch (category) {
        case EntityCategory::BASE: return "BASE";
        case EntityCategory::EXTENDED: return "EXTENDED";
        case EntityCategory::ASSOCIATED: return "ASSOCIATED";
        default: return "Unknown";
    }
}

// 声明模板类
template <EntityCategory... Categories>
class EntityType {
public:
    // 输出实体类型
    void printCategories() {
        std::cout << "Categories: ";
        // (..., (std::cout << static_cast<int>(Categories) << " "));
        (..., (std::cout << typeid(Categories).name() << " "));
        (..., (std::cout << getCategoryString(Categories) << " "));
        std::cout << std::endl;
    }
};

int main() {
    // 使用不同的实体类型实例化模板类
    EntityType<EntityCategory::BASE> baseEntity;
    EntityType<EntityCategory::BASE, EntityCategory::EXTENDED> extendedEntity;
    EntityType<EntityCategory::EXTENDED, EntityCategory::ASSOCIATED> associatedEntity;

    // 输出实体类型
    baseEntity.printCategories(); // 输出: Categories: 0
    extendedEntity.printCategories(); // 输出: Categories: 0 1
    associatedEntity.printCategories(); // 输出: Categories: 1 2

    return 0;
}
